package com.xzz.number;

/**
 * @author: hhz
 * @create: 2022-01-17 15:08
 * 1716. 计算力扣银行的钱
 **/
public class TotalMoney {
    public static void main(String[] args) {
        System.out.println(totalMoney(4));
        System.out.println(totalMoney(10));
        System.out.println(totalMoney(20));
    }
    public static int totalMoney(int n) {
        int sum = 0;
        int start = 1;
        for (int i = 1; i < n+1; i++,start++) {
            if((i-1)%7==0){
                start = (i-1)/7+1;
            }
            sum+=start;
        }
        return sum;
    }
}
